﻿
@using Akso.Entities
@using Akso.Web.Areas.Mpa.Models.Common.Modals
@model Akso.Web.Areas.PSSModule.Models.ItemDetails.CreateOrEditItemDetailModalViewModel
@Html.Partial("~/Areas/Mpa/Views/Common/Modals/_ModalHeader.cshtml", new ModalHeaderViewModel(Model.IsEditMode ? (L("Pages_PSSModule_ItemDetails_Edit") + ": " + Model.ItemDetail.ItemName) : L("Pages_PSSModule_ItemDetails_Create")))
<div class="modal-body">

    <form name="ObjectForm" role="form" novalidate class="form-validation">
        <input type="hidden" name="ItemCategoryId" value="@Model.ItemDetail.ItemCategoryId" />
        @if (Model.IsEditMode)
        {
            <input type="hidden" name="Id" value="@Model.ItemDetail.Id" />
        }
        
        <div class="col-sm-6">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="ItemCode" value="@Model.ItemDetail.ItemCode" class="form-control edited" maxlength="@ItemDetail.MaxNameLength" />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_ItemCode")</label>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="ItemName" value="@Model.ItemDetail.ItemName" class="form-control edited" required maxlength="@ItemDetail.MaxCodeLength" />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_ItemName")</label>
            </div>
        </div>

        <div class="col-sm-6">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="Specification" value="@Model.ItemDetail.Specification" class="form-control edited" maxlength=4 />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_Specification")</label>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="Units" value="@Model.ItemDetail.Units" class="form-control edited" required maxlength="@ItemDetail.MaxUnitLength" />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_Units")</label>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="PurchasePrice" value="@Model.ItemDetail.PurchasePrice" class="form-control edited" required />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_PurchasePrice")</label>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="SalePrice" value="@Model.ItemDetail.SalePrice" class="form-control edited" required />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_SalePrice")</label>
            </div>
        </div>
        <div class="col-sm-12">
            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="Remark" value="@Model.ItemDetail.Remark" class="form-control edited" maxlength="@ItemDetail.MaxRemarkLegth" />
                <label>@L("Pages_PSSModule_ItemDetails_GridColumn_Remark")</label>
            </div>
        </div>
        
    </form>

</div>

@Html.Partial("~/Areas/Mpa/Views/Common/Modals/_ModalFooterWithSaveAndCancel.cshtml")
